package com.sunshineedu.sunshineeducationspring.controller;

import com.sunshineedu.sunshineeducationspring.entity.Test;
import com.sunshineedu.sunshineeducationspring.service.TestService;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/Test")
public class TestController {
    @Resource
    private TestService testService;

    @GetMapping("/{id}")
    public ResponseEntity<Test> findNameById(@PathVariable Long id) {
        Test test = testService.findNameById(id);
        System.out.println(ResponseEntity.ok(test));
        return ResponseEntity.ok(test);
    }
}
